/*Includes ----------------------------------------------------------------------------------------*/
#include "stm32f10x.h"
#include "led.h"

/*Defines -----------------------------------------------------------------------------------------*/
/*Variables ---------------------------------------------------------------------------------------*/
/*Functions ---------------------------------------------------------------------------------------*/

void LED_Init(void){	
	//1.打开控制GPIOC的时钟(APB2)
	RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC, ENABLE);
	
	//2.配置结构体	
	GPIO_InitTypeDef led_init;
	led_init.GPIO_Pin   = GPIO_Pin_13 | GPIO_Pin_14 | GPIO_Pin_15;      //GPIOC13引脚
	led_init.GPIO_Mode  = GPIO_Mode_Out_PP; //推挽输出	
	led_init.GPIO_Speed = GPIO_Speed_10MHz; //10MHz
	
	//3.对成员进行初始化
	GPIO_Init(GPIOC, &led_init);
	
		//1.打开控制GPIOC的时钟(APB2)
	RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);
	
	//2.配置结构体	
	led_init.GPIO_Pin   = GPIO_Pin_8 | GPIO_Pin_9;      //GPIOC13引脚
	led_init.GPIO_Mode  = GPIO_Mode_Out_PP; //推挽输出	
	led_init.GPIO_Speed = GPIO_Speed_10MHz; //10MHz
	
	//3.对成员进行初始化
	GPIO_Init(GPIOB, &led_init);
	LED1Q;LED2;LED3Q;X1L;X2L;
}
/*---------------------------------------------- End ------------------------------------------------*/



